Direct current (DC) motors are often used in many applications, such as computers, printers, automobiles, and stereos. Generally, a DC motor rotates based on a current passing through coils of a rotor of the DC motor to generate a magnetic force, so as to attract or repel a permanent magnet on a stator of the DC motor to make the motor rotate. In some applications, a technique of pulse width modulation (PWM) is often used to modulate the current passing through the DC motor, so as to save power as well as to control rotation speed of the DC motor. For example, the PWM technique usually involves adjusting a period ratio of a power supply transferring energy to the DC motor within a periodical square wave.